/**
 * Created by yangfan on 2016/9/21.
 */
/**
 * Created by yangfan on 2016/8/31.
 */
define(['config/appregister',"../../services/httpServices","i18n","config/editor"],function(app,httpService,i18n,editor){
    app.directive("uiEditor",function(){
        return {
            scope:{
                content:"=setContent"
            },
            link:function(scope,element,attrs){
                //editor.createNewEditor()
                var id = attrs.id;
                //var head = getElementsByTagName("head");
                if(id){
                    editor.createNewEditor(id);
                }

                if(typeof scope.content!="undefined"){
                    editor.$txt.append(scope.content);

                }
            }
        }
    });
});
